﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate;
using Thaire.Investment.Domains.Master;

namespace Thaire.Investment.Repository
{
   public class BankRepo : BaseRepository <Bank, int>
    {
        public BankRepo(ISession session)
            : base(session)
        {
        }

       

        public List<Bank> GetAllBank()
        {
            return new List<Bank>(_session.QueryOver<Bank>()
                .Where(x => x.BankBranchCode =="0000")
                .OrderBy(x => x.BankNameEn).Asc.List());
        }

        public List<Bank> GetBranch(string bankcode)
        {
            return new List<Bank>(_session.QueryOver<Bank>()
                .Where(x => x.BankBranchCode != "0000").And(x=>x.BankCode == bankcode)
                .OrderBy(x => x.BankNameEn).Asc.List());
        }
    }
  
}
